package com.draemoncode.weixindb.repository;


import com.draemoncode.weixindb.domain.B_Calculate_Code;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

public interface B_Calculate_CodeRepository extends JpaRepository<B_Calculate_Code, Integer>{

    public B_Calculate_Code findByEnable(Integer enable);

    public List<B_Calculate_Code> findByNameLike(String name);

    @Query("update B_Calculate_Code set enable=null")
    @Modifying
    @Transactional
    public void disableAll();

}
